package com.jjb.www.ui.activity;

import android.util.Log;

import androidx.recyclerview.widget.LinearLayoutManager;

import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.hjq.shape.layout.ShapeRecyclerView;
import com.jjb.www.R;
import com.jjb.www.app.AppActivity;
import com.jjb.www.http.api.AnsweringDetailsApi;
import com.jjb.www.http.api.CurriculumSortApi;
import com.jjb.www.http.model.HttpList;
import com.jjb.www.ui.adapter.AnsweringDetailsAdapter;
import com.jjb.www.ui.fragment.CourseListFragment;
import com.jjb.www.utils.ReplaceUtils;

/**
 *  作答详情
 */
public class AnsweringDetailsActivity extends AppActivity {
    private ShapeRecyclerView mRvAwerDet;
    private AnsweringDetailsAdapter adapter;
    public static String PaperId = "";
    @Override
    protected int getLayoutId() {
        return R.layout.activity_answering_details;
    }

    @Override
    protected void initView() {
        mRvAwerDet = findViewById(R.id.rv_awer_det);
        mRvAwerDet.setLayoutManager(new LinearLayoutManager(getContext()));
        adapter = new AnsweringDetailsAdapter(getContext());
        mRvAwerDet.setAdapter(adapter);
    }

    @Override
    protected void initData() {
        PaperId = getString("id");
        getListData();
    }

    private void getListData() {
        EasyHttp.get(this)
                .api(new AnsweringDetailsApi()
                .setPaper_id(PaperId)
                .setView_type("1"))
                .request(new HttpCallback<HttpList<AnsweringDetailsApi.Bean>>(this) {

                    @Override
                    public void onSucceed(HttpList<AnsweringDetailsApi.Bean> data) {
                        adapter.setData(data.getData());
                    }

                });
    }
}